﻿using System;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml;
using Castle.Core.Resource;

namespace MyLib
{
    internal class MyConfigResource1 : AbstractResource
    {
        XmlNode _node;
        public MyConfigResource1(XmlNode node)
        {
            _node = node;
        }

        public override TextReader GetStreamReader()
        {
            return new StringReader(_node.OuterXml); 
        }

        public override TextReader GetStreamReader(Encoding encoding)
        {
            throw new NotSupportedException("Encoding is not supported");
        }

        public override IResource CreateRelative(String relativePath)
        {
            return new ConfigResource(relativePath);
        }


    }
}

